<?php
/**
 * Update database tool
 *
 * PHP version 5
 *
 * @category   Web
 * @package    Data2People
 * @subpackage Utils
 * @author     Mike Bevz <mike.bevz@data2people>
 * @copyright  2007-2008 (c) Mike Bevz
 * @license    The BSD License http://data2people.com/license.txt
 * @version    SVN: $Id: $
 *
 */
define('STAGING', 'dev');

require dirname(__FILE__).'/../TV/global.php';
initConfig();

try {
    $opts = new Zend_Console_Getopt('uc');
    $opts->setHelp(
    array(
        'c' => 'Create cloud',
        'u' => 'Update feeds'
        )
    );
    $u = $opts->getOption('u');
    $c = $opts->getOption('c');

    if (!$u && !$c) {
        throw new Zend_Console_Getopt_Exception('Problem', "Usage: dbUpdate.php [ options ]\n-c\tCreate a cloud\n-u\tUpdate feeds");
    }
    
    $opts->parse();
} catch (Zend_Console_Getopt_Exception $e) {
    echo $e->getUsageMessage();
    exit;
}

if ($u) {
    $manager = new TV_Manager_Feeds();
    $manager->update();
}

if ($c) {
    $manager = new TV_Manager_Feeds();
    $manager->createCloud();
    echo 'Tag cloud created!';
}




